UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jZ3k1AZrMKqKYL4kpDX1R2IZ6oN0YRamuw8swpZeUYY=' 
WHERE 
  key_id = 'ea380d781e8a44a90cdacc8bc84d7ee4574387cae638be22d0c172a77c8f18fd' 
  AND (
    token = 'jZ3k1AZrMKqKYL4kpDX1R2IZ6oN0YRamuw8swpZeUYY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028