UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0XEQVli79UBV9AG9XIc3lAVRYVC+6fYLHmbsFVrB5fQ=' 
WHERE 
  key_id = '93538a8031efa8ca1781e0b1821ebad351bbef6695576cfc551db75852a9e83c' 
  AND (
    token = '0XEQVli79UBV9AG9XIc3lAVRYVC+6fYLHmbsFVrB5fQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038