UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UHzoJLgTcJh0AdNmJmYKwTb7/54LM0dbMRJ+AM3+CyQ=' 
WHERE 
  key_id = 'c74b2635eab057f18aa0da88f6c263dcc010fb6f2bb3fa7b319df38140be26c9' 
  AND (
    token = 'UHzoJLgTcJh0AdNmJmYKwTb7/54LM0dbMRJ+AM3+CyQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037