UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'LF0gFYjq1WZ5ZYVvtefHlLNd1rX8WEmmEXpjUotd15M=' 
WHERE 
  key_id = '6dcea85a9ae1011d22cb6026d9e29cd6200b0866f9241443110462f99829e598' 
  AND (
    token = 'LF0gFYjq1WZ5ZYVvtefHlLNd1rX8WEmmEXpjUotd15M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037