UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/l12C26JXw8B/YJB7Feb8EtwBF2JpZNoHuXwH3i+1AA=' 
WHERE 
  key_id = '0e7e343c7ab1860620d0311b1b4c99e76623e4cc6ca78406582e3b989754750e' 
  AND (
    token = '/l12C26JXw8B/YJB7Feb8EtwBF2JpZNoHuXwH3i+1AA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024