UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2FCmVeAqcnvs/4YKFPFcqig3GW1xR+KQkF3kCqa0yfs=' 
WHERE 
  key_id = 'e3d30b748b626b10de886bd25e3d0b0134fd8382f60f15f3d7cdbcb41dc092f5' 
  AND (
    token = '2FCmVeAqcnvs/4YKFPFcqig3GW1xR+KQkF3kCqa0yfs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030