UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oASHiR7F9x6hDEYt7xXrQmgZ+3nDrPufZ/MQLlHdmU0=' 
WHERE 
  key_id = '6c57b9e089a5819e5ee52f5da5e44d85d27872304821ab840a56026bf26518e3' 
  AND (
    token = 'oASHiR7F9x6hDEYt7xXrQmgZ+3nDrPufZ/MQLlHdmU0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047