UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/zs1rQPeF6lb12neNQCFsUvOMO1t74UOpeozDrxQolk=' 
WHERE 
  key_id = '8e875c801b46a01b4426ddea19bf57101c973fc4b29e962d3a6e488db8c73307' 
  AND (
    token = '/zs1rQPeF6lb12neNQCFsUvOMO1t74UOpeozDrxQolk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026