UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'MZDZ3lAkSmsjN8mOpqdoq6v1a336MhpNnOpX6cbUmIY=' 
WHERE 
  key_id = '264d0b8383d6a633c3b4857607bd53081cc4d78ce3450fc75783b7c7a3410c7d' 
  AND (
    token = 'MZDZ3lAkSmsjN8mOpqdoq6v1a336MhpNnOpX6cbUmIY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00071