UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'JXD8mHDSgJTarIBWWHcVwYsQHORZ61SEM+zyYEnOKqw=' 
WHERE 
  key_id = 'c5e503621816be7040cfac1f83412bbcc0d77f37ba6e6f15619d125dc5117b01' 
  AND (
    token = 'JXD8mHDSgJTarIBWWHcVwYsQHORZ61SEM+zyYEnOKqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021