UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ciFBT39qh/hzHDQKBHNaNXHtST/pab1l3Lhd2cIEWwA=' 
WHERE 
  key_id = 'd50f7995674b2c5d6e2fd8f150495798ff8c92ce13b21a1185f7dda7af403e7f' 
  AND (
    token = 'ciFBT39qh/hzHDQKBHNaNXHtST/pab1l3Lhd2cIEWwA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044