UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GekSeNBiX0pNTB4dtgJeuasAIMMH//SgQj/YDqXJh/Y=' 
WHERE 
  key_id = '4ab2a7acd45ff980ad9a23c1565a8193b5ea370be1af8851666e6aede6c3fa46' 
  AND (
    token = 'GekSeNBiX0pNTB4dtgJeuasAIMMH//SgQj/YDqXJh/Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024