UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'X01vegQGFZ/qDVDPH6Lx9QnbWxZ8+DJKtkmiHuKG8Xk=' 
WHERE 
  key_id = '1032a2d4264e96eaf2d3b78c4b8e4b488231cb8e417fd98c6cf623eb7cfd100e' 
  AND (
    token = 'X01vegQGFZ/qDVDPH6Lx9QnbWxZ8+DJKtkmiHuKG8Xk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022