UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jKjM4fgWnz1u7toBqUhAuZ4aJZ+v8B6lZD2Xau7nNYI=' 
WHERE 
  key_id = '5c1e9a274bc46d66c2d10c41ff877f974334f4bb83a7b748bdfa08cc06890ca6' 
  AND (
    token = 'jKjM4fgWnz1u7toBqUhAuZ4aJZ+v8B6lZD2Xau7nNYI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025