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

Query time 0.00092