UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jjoPvtIpQRIXPDRuWbZrRFK6sHAS4BPIJ6bvMpbTZfs=' 
WHERE 
  key_id = '4102af40613acf20b9f1f4fad22a5be209999cd1c16920064cf893b94ec5e0c0' 
  AND (
    token = 'jjoPvtIpQRIXPDRuWbZrRFK6sHAS4BPIJ6bvMpbTZfs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00054