UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'l64KWOGh3Vcl2novf7yPzsNntE/1I7wTUmwVe7ch4co=' 
WHERE 
  key_id = '3004ca0b4468ce4db76a8005143f2926505b361802fdc51ee92143a0619eb4b2' 
  AND (
    token = 'l64KWOGh3Vcl2novf7yPzsNntE/1I7wTUmwVe7ch4co=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025