UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'o1wAJX+2M88saZ6/4Zh5+eJ3N0nKTlFOlYUU/qMkCEA=' 
WHERE 
  key_id = '8381bc51dbcd33bfcd3373ea9dd792ad808d23f1a05745a1d86d04c70e0ce710' 
  AND (
    token = 'o1wAJX+2M88saZ6/4Zh5+eJ3N0nKTlFOlYUU/qMkCEA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00050