UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OHcKkyttoEQ/KVh6Kjqe7fUFbDloS0DmVU6gyHIqU/w=' 
WHERE 
  key_id = 'c2a339583b2d27e92acf36c0fd11b99fff08014184900eb2d1ce3da5c2245087' 
  AND (
    token = 'OHcKkyttoEQ/KVh6Kjqe7fUFbDloS0DmVU6gyHIqU/w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031