UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+7oI+qSxeJi2jDWcaMwn23x/RvOfbSEzZ6GgN5QBIyY=' 
WHERE 
  key_id = 'ead39a533e4dc84ebb689356272881141679e935fd903183c8d6c9146f1eb698' 
  AND (
    token = '+7oI+qSxeJi2jDWcaMwn23x/RvOfbSEzZ6GgN5QBIyY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019