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

Query time 0.00045