UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gS6cJbjhA6ody5RT+mmDAzMM4R+Cln5gY+RHJJQJ568=' 
WHERE 
  key_id = '624b79a130be11de7509dab32c1798f4ec67e757fca0ec83ca8d43391a769913' 
  AND (
    token = 'gS6cJbjhA6ody5RT+mmDAzMM4R+Cln5gY+RHJJQJ568=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021