UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PPLvP02FfE83wZfr8guTmqZEvHGA+G0TUcbu0vs5h+s=' 
WHERE 
  key_id = '1ad3e05b6e4d8f79fd0119b7e8a5cddfd2f0202431a58ce32488b83ced80df99' 
  AND (
    token = 'PPLvP02FfE83wZfr8guTmqZEvHGA+G0TUcbu0vs5h+s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034