UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vnV9gJEABSs1uJXHss/P7/Kr0FoCO5UM4d19SNIJVNM=' 
WHERE 
  key_id = '36fb72fefe10aa6889f386387797527c5456088653f11ac93b82a6c9af209e0c' 
  AND (
    token = 'vnV9gJEABSs1uJXHss/P7/Kr0FoCO5UM4d19SNIJVNM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031