UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mFKzuF54w0B4kBQOKxBls9pi9kkZASh7Xr06QH4UAuE=' 
WHERE 
  key_id = 'b38886b53a5e070ef9a281812c055cc4742e12a9b4bbcf3cc5dfbc93efb7b832' 
  AND (
    token = 'mFKzuF54w0B4kBQOKxBls9pi9kkZASh7Xr06QH4UAuE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034