UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Dpc4Le1VX5s3fJ/wpzDhDqS2kg0640l2vOnGIUnkua0=' 
WHERE 
  key_id = 'e08168644539ca43a00df9bab2936f1902ca3370835348b33e4d473eb12e0127' 
  AND (
    token = 'Dpc4Le1VX5s3fJ/wpzDhDqS2kg0640l2vOnGIUnkua0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015