UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cV+QRta7VjB/KGfGKf8pzZMwxEQDdF3FgAH99PpZyZU=' 
WHERE 
  key_id = 'd75d06be41a20e0c8cdba0f954a14eb71f4846aa0c8f994079f49d75ec27197c' 
  AND (
    token = 'cV+QRta7VjB/KGfGKf8pzZMwxEQDdF3FgAH99PpZyZU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00018