UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'gJJY/LxiNDX6FhP4CAQSckZuRorAPNgIxCr24EZoIfM=' 
WHERE 
  key_id = '9e53968acaf058d87b4a52c48ea8e00dd8c3e52bf52d33b8882eff52037034c6' 
  AND (
    token = 'gJJY/LxiNDX6FhP4CAQSckZuRorAPNgIxCr24EZoIfM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031