UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rnea35bw9w8qOaSXSJHNfEnXKQy7DDZO5ikiFq/7v8U=' 
WHERE 
  key_id = '5a30bd6d8a400ebceedffdc5a33faa0ad878ef04708712e84552b70d985c1296' 
  AND (
    token = 'Rnea35bw9w8qOaSXSJHNfEnXKQy7DDZO5ikiFq/7v8U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038