UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'fpPRH6NAaYz/hIC1+DRWU7j0j8272Bk1qM7SufuMKFY=' 
WHERE 
  key_id = 'b46efe549cdd3b34d01f01506cda8d852d63a761473ae1f711f61268f511f017' 
  AND (
    token = 'fpPRH6NAaYz/hIC1+DRWU7j0j8272Bk1qM7SufuMKFY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054