UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '3ebW3YE9iMZtrM/WW5S+qlcv1OkQsRdG/zy18QsIMak=' 
WHERE 
  key_id = 'ae5d0b8650b65ffb30090e7d0aa0572222c0571d4410e7b613dd63732ab6b859' 
  AND (
    token = '3ebW3YE9iMZtrM/WW5S+qlcv1OkQsRdG/zy18QsIMak=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00052