UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Jihf/u97JIpiaYRp5FmQyWsUuzb/mhUkRWNhwcdfX1k=' 
WHERE 
  key_id = 'fc4a8e0186d10984f126131a9b1a879582c1db7b9f90c56321ba8031e6d5597b' 
  AND (
    token = 'Jihf/u97JIpiaYRp5FmQyWsUuzb/mhUkRWNhwcdfX1k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033